package org.example.zuoye.service.impl;

import lombok.RequiredArgsConstructor;
import org.example.zuoye.mapper.ChartsMapper;
import org.example.zuoye.service.ChartsService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author xinchen
 * @Date: 2024/08/17/ 20:54
 * @Description
 */
@Service
@RequiredArgsConstructor
public class ChartsServiceImpl implements ChartsService {
    private final ChartsMapper chartsMapper;
    /**
     * 获取患者总数
     * @return
     */
    @Override
    public Map<String, Object> getPatientTotal() {
        return chartsMapper.getPatientTotal();
    }

    @Override
    public Map<String, Object> getDoctorTotal() {
        return chartsMapper.getDoctorTotal();
    }

    @Override
    public Map<String, Object> getScheduleTotal() {
        return chartsMapper.getScheduleTotal();
    }

    @Override
    public Map<String, Object> getAppointTotal() {
        return chartsMapper.getAppointTotal();
    }

    @Override
    public List gethotDoctor(Date date) {
        return chartsMapper.selectDoctorOrderByScheduleCount(date);
    }

    @Override
    public List hotAppoint(Date date) {
        return chartsMapper.selectApponinOrderBydoctorCount(date);
    }

    /**
     * 预约趋势：统计某天预约人数
     * @param date
     * @return
     */
    @Override
    public List getAppointCount(Date date) {
        return chartsMapper.getAppointCount(date);
    }

    /**
     * 本周每天的放号数量
     * @param date
     * @return
     */
    @Override
    public List getWeekSchedule(Date date) {
        return chartsMapper.getWeekSchedule(date);
    }

    /**
     * 本周每天的预约数量
     * @param date
     * @return
     */
    @Override
    public List getWeekAppoint(Date date) {
        return chartsMapper.getWeekAppoint(date);
    }
}
